//-----------------------------------------------------------------------------
//  Copyright (C) 2005-2008 Thomas S. Ullrich 
//
//  This file is part of the Solitaire Mahjong project.
//
//  This file may be used under the terms of the GNU General Public License.
//  This project is free software; you can redistribute it and/or modify it
//  under the terms of the GNU General Public License.
//  
//  Author: Thomas S. Ullrich
//  Last update: November 14, 2008
//-----------------------------------------------------------------------------
#include <QApplication>
#include <QSplashScreen>
#include "smMainWindow.h" 
#include "smVersion.h" 

int main(int argc, char** argv)
{
    Q_INIT_RESOURCE(smResources);
	
    QApplication app(argc, argv);
    
    QPixmap pixmap(":/aboutImage/images/aboutPixmap.png");
#if defined(Q_OS_WIN32)
    QSplashScreen splash(pixmap, Qt::WindowStaysOnTopHint);
#else
    QSplashScreen splash(pixmap);
#endif
    splash.showMessage("Version "VERSION);
    splash.show();
    
    app.processEvents();
#if defined(Q_OS_WIN32)
    _sleep(2000);
#else
    sleep(2);   // give the splash screen a fighting chance 
#endif
    
    smMainWindow window;  
    window.show();
    
    splash.finish(&window);
    app.connect(&app, SIGNAL(lastWindowClosed()), &app, SLOT(quit()));

    return app.exec();
}
